package binary_tree.Newcode;

import java.util.Arrays;
import java.util.Scanner;

public class level {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int [] arr=new int[3*n];
        for(int i=0;i<arr.length;i++)
            arr[i]=sc.nextInt();
            Arrays.sort(arr);
            long sum=0;
            for(int i=n;i<arr.length-1;i+=2)
                sum+=arr[i];
                System.out.println(sum);

    }
}
